package com.zcily.demo.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author CGG
 * @since 2025-11-05
 */
@Getter
@Setter
@TableName("sys_user")
@ApiModel(value = "User对象", description = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("登录账号")
    @TableField("username")
    private String username;

    @ApiModelProperty("真实姓名")
    @TableField("realname")
    private String realname;

    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("md5密码盐")
    @TableField("salt")
    private String salt;

    @ApiModelProperty("头像")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty("生日")
    @TableField("birthday")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date birthday;

    @ApiModelProperty("性别(0-默认未知,1-男,2-女)")
    @TableField("sex")
    private Boolean sex;

    @ApiModelProperty("电子邮件")
    @TableField("email")
    private String email;

    @ApiModelProperty("电话")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("登录会话的机构编码")
    @TableField("org_code")
    private String orgCode;

    @ApiModelProperty("性别(1-正常,2-冻结)")
    @TableField("status")
    private Boolean status;

    @ApiModelProperty("删除状态(0-正常,1-已删除)")
    @TableField("del_flag")
    private Boolean delFlag;

    @ApiModelProperty("第三方登录的唯一标识")
    @TableField("third_id")
    private String thirdId;

    @ApiModelProperty("第三方类型")
    @TableField("third_type")
    private String thirdType;

    @ApiModelProperty("同步工作流引擎(1-同步,0-不同步)")
    @TableField("activiti_sync")
    private Boolean activitiSync;

    @ApiModelProperty("工号，唯一键")
    @TableField("work_no")
    private String workNo;

    @ApiModelProperty("职务，关联职务表")
    @TableField("post")
    private String post;

    @ApiModelProperty("座机号")
    @TableField("telephone")
    private String telephone;

    @ApiModelProperty("创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("更新人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty("更新时间")
    @TableField("update_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty("身份（1普通成员 2上级；前端已经写死，直接返回）")
    @TableField("user_identity")
    private Boolean userIdentity;

    @ApiModelProperty("用户类型(1-普通用户 2-后端用户),后端用户为系统后端程序使用，例如：定时任务中使用")
    @TableField("user_type")
    private Integer userType;

    @ApiModelProperty("负责部门")
    @TableField("depart_ids")
    private String departIds;

    @ApiModelProperty("设备ID")
    @TableField("client_id")
    private String clientId;

    @ApiModelProperty("上次登录选择租户ID")
    @TableField("login_tenant_id")
    private Integer loginTenantId;

    @ApiModelProperty("流程入职离职状态")
    @TableField("bpm_status")
    private String bpmStatus;

    @ApiModelProperty("密码更新时间*")
    @TableField("pwd_update_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date pwdUpdateTime;

    @ApiModelProperty("微信小程序唯一标识*")
    @TableField("openid")
    private String openid;

    @ApiModelProperty("微信小程序所属租户编号*")
    @TableField("wxid")
    private Integer wxid;

    @ApiModelProperty("微信小程序推送剩余次数*")
    @TableField("wxpush")
    private Integer wxpush;
}
